package edu.bbk.muc.lifetracker.common;

import junit.framework.TestCase;

public class EventTest extends TestCase {
  public void testSerialization() {
    Event event = new Event(123L, new Acceleration(1, 2, 3), null, null);
    String json = event.toJSON();
    assertNotNull(json);
    Event e2 = Event.fromJSON(json);

    assertEquals(123, e2.getTimestamp().longValue());
    assertEquals(2.0f, e2.getAcceleration().getYAcceleration().floatValue());
  }
}
